// TOWN DIALOGUE SCRIPT
// 	Town 2: Timoria

// This is the dialogue for this town.
// You can use states numbered from 1 to 99.

begintalkscript;

variables;

// *** Faustulus ***

begintalknode 1;
	state = -1;
	personality = 20;
	nextstate = 1;
	condition = 1;
	question = "Faustulus";
	text1 = "_Greetings,_ he says as you approach. _My name is Faustulus. I am the empire's deputy here in Ateria. I report to the empire's personal governor of Dacia. I am in charge here. I administrate this area. I am the one responsible._";
	text2 = "He clenches and unclenches his hands as he speaks, his eyes darting to each corner of the room.";
	text5 = "_Yes?_ Faustulus says, leaning forward, then jolting backward, his left arm twitching.";
	action = INTRO;

begintalknode 2;
	state = 1;
	personality = 20;
	nextstate = 1;
	condition = 1;
	question = "We are the ones you sent for. What should we do?";
	text1 = "_When you have finished... finished... finished, you can return here._ He pauses. _For your reward._";
	text3 = "_Go to Castle Puteum in the northwest and look for Putidus._ The lord twitches.";
	code =
	if (get_flag(2,1) == 0) // hasn't received mission
		remove_string(3);
	else
		remove_string(1);
	if (get_flag(2,1) == 0) {
	reset_dialog();
	add_dialog_str(0,"_Yes, you... you are the soldiers._ He pulls a sheet of paper off the top of the rostrum in front of him and looks towards it for a moment, his eyes unfocused, then puts it back on the rostrum. _You have come. I should tell you... what to do._",0);
	add_dialog_str(1,"His left shoulder spasms upward, falling hopelessly back down. _When the empire conquers a new... a new... a new province, we negotiate a treaty with the local ruler in order to maintain... maintah... maintain the structures of power._",0);
	add_dialog_str(2,"He trembles violently for a moment, then calms. _The local lord here is named Putidus, and he lives in Castle Puteum in the northwest at the top of this hill. He... has not been seen recently._ He stands up from his chair and immediately sits again.",0);
	add_dialog_str(3,"_We want you to invest... inv... investigate. Find Putidus, if he's still alive._ Suddenly he bends so his head almost touches the floor and lets out a liquid burst of wheezing and bloody coughing, wracking his whole body.",0);
	add_dialog_str(4,"_Find the lord,_ he chokes out, slowly sitting upright again. _Do it for us all._",0);
	set_flag(2,1,run_dialog(1));
	}
break;
	
begintalknode 3;
	state = 1;
	personality = 20;
	nextstate = 1;
	condition = 1;
	question = "Do you know anything about the disappearances?";
	text1 = "He falls completely still for a moment. You watch his pupils dilate and contract, and gradually his left arm begins to twitch, slightly at first, but more and more out of control as you watch.";
	text2 = "_Disap... disappearances?_ he says. _No. No. Not at all. I don't know anything. I am in charge. But I don't know anything about that._";

begintalknode 4;
	state = 1;
	personality = 20;
	nextstate = 1;
	condition = 1;
	question = "Are you feeling okay?";
	text1 = "_I have been ill lately,_ he says. _Events have put a strain on me. But I am improving, and I hope to make a comple... compl... complete recovery._";

begintalknode 5;
	state = 1;
	personality = 20;
	nextstate = 1;
	condition = get_flag(201,1) < 3;
	question = "Is there anything small I can do for you?";
	text1 = "_Yes. We've had some trouble with the animals in the forest lately. The bears and wolves have been eating our crops and attacking our city._ He rubs his left arm roughly, audibly scratching it.";
	text2 = "_If you can find the source of the trouble and eliminate it, I will reward you._";

begintalknode 6;
	state = 1;
	personality = 20;
	nextstate = 1;
	condition = (get_flag(201,1) >= 3) && (get_flag(2,3) == 0);
	question = "We found the source of the animals. (Tell him about your encounter.)";
	text1 = "He listens calmly as you describe your struggles getting to the cave and slaying the creatures. Then, when you ask him about the spirits that you found, he sputters.";
	text2 = "_Ghosts? The dead?_ He wheezes, his hands idly reaching toward his throat and clenching loosely. _I do not know what this could portend. We will perform rituals of purification. That will keep us safe. Safe. Safe._";
	text3 = "His head twiches to the left sharply, then rights. _In the meantime, here is your reward. We do not have much money, but we do have a beautiful sword that you may have._ He hands you a steel longsword.";
	code =
	set_flag(2,3,reward_give(57));
break;

// Fasa

begintalknode 10;
	state = -1;
	personality = 21;
	nextstate = 5;
	condition = 1;
	question = "Fasa";
	text1 = "This woman has been staring into the pond, but she looks up at  you as you approach. _Hello,_ she says. _My name is Fasa._";

begintalknode 11;
	state = 5;
	personality = 21;
	nextstate = 5;
	condition = 1;
	question = "What do you do?";
	text1 = "_I am a sage. I have been many places and seen many things, so I can identify your items. I also spend my time thinking._";

begintalknode 12;
	state = 5;
	personality = 21;
	nextstate = 5;
	condition = 1;
	question = "Do you know anything about the disappearances?";
	text1 = "_Yes,_ she says, _I know what is responsible. The encroaching wolves and bears of the forest to the west and down the road to the north have killed many, particularly unarmed women and children who wandered too far from home._";
	text2 = "She sighs. _As soon as the animals have been reduced in number, I want to head toward Umbratium. There are herbs to the east of there that will be useful for my studies. Right now it is not safe, but once those animals have been disposed of, I will go._";

begintalknode 13;
	state = 5;
	personality = 21;
	nextstate = 6;
	condition = get_flag(201,1) >= 3;
	question = "I destroyed the source of the animals. The paths are safer now.";
	text1 = "_Really? How wonderful! I shall leave at once._";
	
begintalknode 14;
	state = 6;
	personality = 21;
	nextstate = -1;
	condition = 1;
	question = "Have a good trip.";
	text1 = "_Thank you. I will._ She smiles and adds, _You have done a good thing here._ With that, she walks out the city gates.";
	code =
	erase_char(10);
	set_flag(2,2,1);
	end();
break;

begintalknode 15;
	state = 6;
	personality = 21;
	nextstate = -1;
	condition = 1;
	question = "It's probably not safe. Let us come with you and guard you.";
	text1 = "_Thank you, but that is not necessary. I will be fine with the animals gone. After all, they were the cause of the disappearances._";
	text2 = "She smiles and adds, _You have done a good thing here._ With that, she walks out the city gates.";
	code =
	erase_char(10);
	set_flag(2,2,1);
	end();
break;
	
begintalknode 16;
	state = 5;
	personality = 21;
	nextstate = 5;
	condition = 1;
	question = "Can you identify my items?";
	text1 = "_Yes, of course, for a small fee._";
	action = ID 5;

// Scaevola

begintalknode 20;
	state = -1;
	personality = 22;
	nextstate = 10;
	condition = 1;
	question = "Scaevola";
	text1 = "_Hello,_ this man says as you approach. _My name is Scaevola. Welcome to my shop._";
	text5 = "_What else can I do for you?_ he asks.";
	action = INTRO;

begintalknode 21;
	state = 10;
	personality = 22;
	nextstate = 11;
	condition = 1;
	question = "What do you sell?";
	text1 = "_Food and some basic supplies,_ he replies. _Would you like to purchase some?_";
	
begintalknode 22;
	state = 11;
	personality = 22;
	nextstate = 10;
	condition = 1;
	question = "No, thanks.";
	text1 = "_As you wish._";
	
begintalknode 23;
	state = 11;
	personality = 22;
	nextstate = 10;
	condition = 1;
	question = "Food, please.";
	text1 = "You finish shopping.";
	code =
	begin_shop_mode("Scaevola's Foods","Scaevola sells a few different kinds of home-grown food.",0,3,-1);
break;

begintalknode 24;
	state = 11;
	personality = 22;
	nextstate = 10;
	condition = 1;
	question = "I'd like some supplies.";
	text1 = "You finish shopping.";
	code =
	begin_shop_mode("Scaevola's Supplies","Scaevola offers you a few basic necessities, and he'll buy from you, too.",1,2,2);
break;

begintalknode 25;
	state = 10;
	personality = 22;
	nextstate = 10;
	condition = 1;
	question = "Do you know anything about the disappearances?";
	text1 = "Scaevola's face darkens. _Yes,_ he says. _I certainly do. My wife was one of the ones who disappeared, and I can tell you that no animal did it. It was that vile Lord Putidus._ He looks around carefully to make sure that no one is listening.";
	text2 = "_You see,_ he says once he is satisfied that no one is, _everyone knows it. They're just too afraid to say it. Lord Putidus is stealing our wives and children. I don't know what he is doing with them or why he wants them, but he is the one doing it._";
	text3 = "He clenches his fists. _My wife was not killed by some bear or wolf. She was abducted by that foul lord in the castle on the top of the hill, and I would do anything to get her back._";

begintalknode 26;
	state = 10;
	personality = 22;
	nextstate = 10;
	condition = 1;
	question = "Is there anything we can do for you?";
	text1 = "_Yes, in fact,_ he says. _You passed through Umbratium to come here, didn't you?_ You respond in the affirmative. _I once knew the family that lives there. I will reward you if you take them a message._ He hands you a letter from under the counter.";
	text3 = "_Just take the letter to Collatinus and Lucretia in Umbratium,_ he replies.";
	text5 = "_No,_ he says. _Not unless you can bring my wife back._";
	code =
	clear_strings();
	if (get_flag(2,4) > 1)
		add_string(5);
	if (get_flag(2,4) == 1)
		add_string(3);
	if (get_flag(2,4) == 0) {
		set_flag(2,4,1);
		set_flag(250,0,2);
		add_string(1);
		}
break;

begintalknode 27;
	state = 10;
	personality = 22;
	nextstate = 10;
	condition = (get_flag(2,5) == 0) && (get_flag(2,4) == 2);
	question = "We gave the letter to Collatinus. (Describe what happened.)";
	text1 = "Scaevola stares at you agape as you describe the scene in Umbratium. _Truly, he was the only man left in the city?_ You nod. _That was once a great city with many citizens. Curse these foul years that have destroyed the fair Umbratium!_";
	text2 = "His hands rise to the air in fists. _O most horrible times that have come upon us! How we are beset! Curse that Lord Putidus, rotten in spirit and foul at his most inner core, who is responsible for our pain! Curse his lusts and injustice!_";
	text3 = "Scaevola catches himself. He seems to realize that he has gone too far. _I... I hope that you will not repeat any of that._ He looks at you meaningfully. _The Lord Putidus is wise and hears much._";
	text4 = "In awkwardness, he turns away, not wishing to continue your conversation. He hands you your reward, a good shield, and says no more.";
	code =
	set_flag(2,5,1);
	reward_give(133);
	end();
break;